# 最低版本要求
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

# 项目名称
PROJECT(liblua)

# 配置vsocdedebug

INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src)


set(cmake_build_type "Debug")
set(cmake_cxx_flage_debug "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")
set(cmake_cxx_flags_release "$ENV{CXXFLAGS} -03 -Wall")



#核心库模块
AUX_SOURCE_DIRECTORY(./src lIBLUA_DIR_SRCS)
list(REMOVE_ITEM lIBLUA_DIR_SRCS ./src/luac.c)
list(REMOVE_ITEM lIBLUA_DIR_SRCS ./src/lua.c)

AUX_SOURCE_DIRECTORY(./src LUA_DIR_SRCS)
list(REMOVE_ITEM LUA_DIR_SRCS ./src/luac.c)

ADD_LIBRARY(lua5.3 STATIC ${lIBLUA_DIR_SRCS})

#编译luac
SET(LUAC_DIR_SRCS ./src/luac.c)

ADD_EXECUTABLE(luac ${LUAC_DIR_SRCS})
ADD_EXECUTABLE(lua ${LUA_DIR_SRCS})

TARGET_LINK_LIBRARIES(luac lua5.3 m )

TARGET_LINK_LIBRARIES(lua m)